<template>
  <div style="height: 100%">
    <el-table
        :data="yhList"
        stripe
        height="100%"
        style="width: 100%">
      <el-table-column
          label="序号"
          type="index"
          width="50">
      </el-table-column>
      <el-table-column
          label="名称"
          prop="mc"
          width="235px">
      </el-table-column>
      <el-table-column
          label="登陆别名"
          prop="dlbm"
          show-overflow-tooltip>
      </el-table-column>
      <el-table-column
          label="创建时间"
          prop="cjsj"
          width="135px">
      </el-table-column>
      <el-table-column
          label="操作"
          width="150px">
        <template slot-scope="{row}">
          <el-button @click="">编辑</el-button>
          <el-button type="danger" @click="preDel(deleteYh,row)" v-show="row.sfsc==='N'">删除</el-button>
          <el-button type="primary" @click="undeleteYh(row)" v-show="row.sfsc==='Y'">恢复</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import commonMixins from "@/mixins/commonMixins";

export default {
  mixins: [commonMixins],
  name: "Yhgl",
  data() {
    return {
      yhList: []
    }
  },
  mounted() {
    this.queryYhList()
  },
  methods: {
    async queryYhList() {
      this.yhList = await this.$api.queryYhList({})
    },
    async deleteYh(yh) {
      await this.$api.deleteYh({rybm: yh.rybm})
      this.queryYhList()
    },
    async undeleteYh(yh) {
      await this.$api.undeleteYh({rybm: yh.rybm})
      this.queryYhList()
    }
  }
}
</script>

<style scoped>

</style>
